<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.validation.min.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/admincp.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.tooltip.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.cookie.js"></script>
<link href="{HEJIN_PATH}public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile2" />
<link href="{HEJIN_PATH}public/admin/css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="{HEJIN_PATH}public/jscolor/jscolor.js"></script>
<link href="{HEJIN_PATH}public/datetimepicker/jquery.datetimepicker.css" rel="stylesheet" type="text/css"></link>
<script src="{HEJIN_PATH}public/datetimepicker/jquery.datetimepicker.js" type="text/javascript"></script>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
<div class="h3" style="width:auto;"><!--{eval echo stripslashes($voteinfo['title']);}--> {lang hejin_ggk:ggksjgl}</div>
      <ul class="tab-base">
        <li><a href="$SELF?action=plugins&operation=config&do={$_GET['do']}&identifier=hejin_ggk&pmod=ggk&model=jiangs&gid=$jinfo['gid']"><span>{lang hejin_ggk:ggksjgl}</span></a></li>
        <li><a href="$SELF?action=plugins&operation=config&do={$_GET['do']}&identifier=hejin_ggk&pmod=ggk&model=addjs&gid=$jinfo['gid']"><span>{lang hejin_ggk:tjggkjl}</span></a></li>
      </ul>
    </div>
  </div>
  <form id="add_form" method="post" enctype="multipart/form-data" action="">
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <input type="hidden" name="jid" value="$jinfo['id']" />
    <input type="hidden" name="gid" value="$jinfo['gid']" />
    <table class="table tb-type2">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_title">{lang hejin_ggk:jiangmc}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo stripslashes($jinfo['title']);}-->" name="title" id="class_name" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_number">{lang hejin_ggk:number}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="$jinfo['number']" name="number" id="class_number" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="class_pic">{lang hejin_ggk:jppic}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
                            <img src="{HEJIN_PATH}$jinfo['pic']" width="150">
                          </div>
            </span> <span class="type-file-box">
            <input name="old_pic" type="hidden" value="" />
            <input name="pic" type="file" class="type-file-file" id="class_pic" size="30" hidefocus="true" nc_type="microshop_goods_class_image">
            </span></td>
          <td class="vatop tips"><span class="vatop rowform">{lang hejin_ggk:jianyicc}640px * N px</span></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_jpname">{lang hejin_ggk:jiangnr}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><textarea id="class_jpname" name="jpname"><!--{eval echo stripslashes($jinfo['jpname']);}--></textarea></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_start">{lang hejin_ggk:paixu}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="$jinfo['start_us']" name="start_us" id="class_start" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>




        <tr>
          <td colspan="2" class="required" style="font-size:16px; color:#900;">{lang hejin_ggk:sjxinxisz}</td>
        </tr>



        <tr>
          <td colspan="2" class="required"><label for="test_sjname">{lang hejin_ggk:sjname}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo stripslashes($jinfo['sjname']);}-->" name="sjname" id="class_sjname" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_wxurl">{lang hejin_ggk:sjwxurl}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo stripslashes($jinfo['wxurl']);}-->" name="wxurl" id="class_wxurl" class="txt"></td>
          <td class="vatop tips">{lang hejin_ggk:wxurltsa}&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mp.weixin.qq.com/s?__biz=MzA5NjY0NzMwNA==&mid=201703727&idx=1&sn=9cb1b35445c15142a39b8e98a776fec8#rd" target="_blank">{lang hejin_ggk:wxurltsb}</a></td>
        </tr>



        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_sjhdurl">{lang hejin_ggk:sjhdurl}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo stripslashes($jinfo['sjhdurl']);}-->" name="sjhdurl" id="class_sjhdurl" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>


        <tr class="noborder">
          <td colspan="2" class="required"><label for="class_sjpic">{lang hejin_ggk:sjpic}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">{if $jinfo['sjpic']}<span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
                            <img src="{HEJIN_PATH}$jinfo['sjpic']" width="150">
                          </div>
            </span>{/if} <span class="type-file-box">
            <input name="old_sjpic" type="hidden" value="" />
            <input name="sjpic" type="file" class="type-file-file" id="class_sjpic" size="30" hidefocus="true" nc_type="microshop_goods_class_image">
            </span></td>
          <td class="vatop tips"><span class="vatop rowform">{lang hejin_ggk:jianyicc}640px * N px</span></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_telphone">{lang hejin_ggk:shangjrx}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo stripslashes($jinfo['telphone']);}-->" name="telphone" id="class_telphone" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_address">{lang hejin_ggk:shangdz}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo stripslashes($jinfo['address']);}-->" name="address" id="class_address" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>



<tr class="noborder">
          <td colspan="2" class="required"><label>{lang hejin_ggk:sjjianj}</label></td>
        </tr>
        <tr class="noborder">
          <td colspan="2" class="vatop rowform"><textarea id="descrip" name="descrip" style="width:700px;height:300px;visibility:hidden;"><!--{eval echo stripslashes($jinfo['descrip']);}--></textarea>
<script src="{HEJIN_PATH}public/kindeditor/kindeditor-min.js" charset="utf-8"></script>
<script src="{HEJIN_PATH}public/kindeditor/lang/zh_CN.js" charset="utf-8"></script>
<script>
	var KE;
  KindEditor.ready(function(K) {
        KE = K.create("textarea[name='descrip']", {
						items : ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', '|', 'selectall', 'clearhtml','quickformat','|',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about'],
						cssPath : "{HEJIN_PATH}public/kindeditor/themes/default/default.css",
						allowImageUpload : false,
						allowFlashUpload : false,
						allowMediaUpload : false,
						allowFileManager : false,
						syncType:"form",
						afterCreate : function() {
							var self = this;
							self.sync();
						},
						afterChange : function() {
							var self = this;
							self.sync();
						},
						afterBlur : function() {
							var self = this;
							self.sync();
						}
        });
			KE.appendHtml = function(id,val) {
				this.html(this.html() + val);
				if (this.isCreated) {
					var cmd = this.cmd;
					cmd.range.selectNodeContents(cmd.doc.body).collapse(false);
					cmd.select();
				}
				return this;
			}
	});
</script>
	</td>
        </tr>
      </tbody>
      <tfoot>
        <tr>
          <td colspan="2"><input name="edit_js" class="btn" type="submit" value="{lang hejin_ggk:baocun}" /></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script type="text/javascript">
$(document).ready(function(){

    var textButton="<input type='text' name='pic' id='textfield1' class='type-file-text' /><input type='button' name='button' id='button1' value='' class='type-file-button' />";
    $(textButton).insertBefore("#class_pic");
    $("#class_pic").change(function(){
        $("#textfield1").val($("#class_pic").val());
    });


    var textButtona="<input type='text' name='sjpic' id='textfield2' class='type-file-text' /><input type='button' name='button' id='button1' value='' class='type-file-button' />";
    $(textButtona).insertBefore("#class_sjpic");
    $("#class_sjpic").change(function(){
        $("#textfield2").val($("#class_sjpic").val());
    });


 /*   var textButtona="<input type='text' name='upnumpic' id='textfield3' class='type-file-text' /><input type='button' name='button' id='button1' value='' class='type-file-button' />";
    $(textButtona).insertBefore("#class_upnumpic");
    $("#class_upnumpic").change(function(){
        $("#textfield3").val($("#class_upnumpic").val());
    });  */



    $("#submit").click(function(){
        $("#add_form").submit();
    });

    $("input[nc_type='microshop_goods_class_image']").live("change", function(){
		var src = getFullPath($(this)[0]);
		$(this).parent().prev().find('.low_source').attr('src',src);
		$(this).parent().find('input[class="type-file-text"]').val($(this).val());
	});


    $('#add_form').validate({
        errorPlacement: function(error, element){
            error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        success: function(label){
            label.addClass('valid');
        },
        rules : {
            title: {
                required : true,
                maxlength : 255
            },
            number: {
                required : true,
                digits: true,
                min: 1
            },
            jpname: {
                required : true,
                maxlength : 1000
            },
            start_us: {
                required : true,
                digits: true,
            }
        },
        messages : {
            title: {
                required : "{lang hejin_ggk:addstmsga}",
                maxlength : jQuery.validator.format("{lang hejin_ggk:addstmsgb}255")
            },
            number: {
                required : "{lang hejin_ggk:addstmsga}",
                digits: "{lang hejin_ggk:addstmsgf}",
                min : jQuery.validator.format("{lang hejin_ggk:addstmsgg}1")
            },
            jpname: {
                required : "{lang hejin_ggk:addstmsga}",
                maxlength : jQuery.validator.format("{lang hejin_ggk:addstmsgb}1000")
            },
            start_us: {
                required : "{lang hejin_ggk:addstmsga}",
                digits: "{lang hejin_ggk:addstmsgf}",
            }
        }
    });
});
</script> 
